package com.ninetaildemonfox.zdl.socialproject.mvp.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.ninetaildemonfox.zdl.socialproject.base.BaseActivity;
import com.ninetaildemonfox.zdl.socialproject.R;
import com.ninetaildemonfox.zdl.socialproject.mvp.presenter.BindingAliPayPresenter;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * @author NineTailDemonFox
 * @date 2019/7/22 16:35
 * 功能描述： 支付宝绑定
 * 联系方式：1037438704@qq.com
 */
public class BindingAliPayActivity extends BaseActivity {
    @BindView(R.id.image_left_finish)
    ImageView imageleftFinish;
    @BindView(R.id.text_center)
    TextView textCenter;
    @BindView(R.id.text_right)
    TextView textRight;
    @BindView(R.id.text_binding)
    TextView textBinding;
    @BindView(R.id.edit_account)
    EditText editAccount;
    @BindView(R.id.edit_name)
    EditText editName;
    private BindingAliPayPresenter bindingAliPay;

    @Override
    protected int getLayoutResource() {
        return R.layout.activity_binding_ali_pay;
    }

    @Override
    protected void onInitialization(Bundle bundle) {
        textCenter.setText("绑定支付宝");
        imageleftFinish.setVisibility(View.VISIBLE);
        bindingAliPay = new BindingAliPayPresenter();
    }

    @OnClick({R.id.image_left_finish, R.id.text_binding})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.image_left_finish:
                finish();
                break;
            case R.id.text_binding:
                bindingAliPay.getBindAliPay(this, me, token, editAccount.getText().toString().trim()
                        , editName.getText().toString().trim());
                break;
            default:
        }
    }
}
